//
// File: eml_mtimes_helper.cpp
//
// MATLAB Coder version            : 5.4
// C/C++ source code generated on  : 25-Apr-2025 12:42:26
//

// Include Files
#include "eml_mtimes_helper.h"
#include "freqDomainHRV_types.h"
#include "rt_nonfinite.h"
#include "coder_array.h"
#include <string.h>

// Function Definitions
//
// Arguments    : struct9_T *in1
//                const coder::array<double, 2U> &in2
// Return Type  : void
//
void c_binary_expand_op(struct9_T *in1, const coder::array<double, 2U> &in2)
{
  int i;
  int loop_ub;
  int stride_0_1;
  int stride_1_1;
  if (in2.size(1) == 1) {
    i = in1->wav.hrv.aHF.size(1);
  } else {
    i = in2.size(1);
  }
  in1->wav.hrv.pHF.set_size(1, i);
  stride_0_1 = (in1->wav.hrv.aHF.size(1) != 1);
  stride_1_1 = (in2.size(1) != 1);
  if (in2.size(1) == 1) {
    loop_ub = in1->wav.hrv.aHF.size(1);
  } else {
    loop_ub = in2.size(1);
  }
  for (i = 0; i < loop_ub; i++) {
    in1->wav.hrv.pHF[i] =
        in1->wav.hrv.aHF[i * stride_0_1] / in2[i * stride_1_1] * 100.0;
  }
}

//
// Arguments    : struct9_T *in1
//                const coder::array<double, 2U> &in2
// Return Type  : void
//
void d_binary_expand_op(struct9_T *in1, const coder::array<double, 2U> &in2)
{
  int i;
  int loop_ub;
  int stride_0_1;
  int stride_1_1;
  if (in2.size(1) == 1) {
    i = in1->wav.hrv.LFHF.size(1);
  } else {
    i = in2.size(1);
  }
  in1->wav.hrv.pLF.set_size(1, i);
  stride_0_1 = (in1->wav.hrv.LFHF.size(1) != 1);
  stride_1_1 = (in2.size(1) != 1);
  if (in2.size(1) == 1) {
    loop_ub = in1->wav.hrv.LFHF.size(1);
  } else {
    loop_ub = in2.size(1);
  }
  for (i = 0; i < loop_ub; i++) {
    in1->wav.hrv.pLF[i] =
        in1->wav.hrv.LFHF[i * stride_0_1] / in2[i * stride_1_1] * 100.0;
  }
}

//
// Arguments    : struct9_T *in1
//                const coder::array<double, 2U> &in2
// Return Type  : void
//
void e_binary_expand_op(struct9_T *in1, const coder::array<double, 2U> &in2)
{
  int i;
  int loop_ub;
  int stride_0_1;
  int stride_1_1;
  if (in2.size(1) == 1) {
    i = in1->wav.hrv.aVLF.size(1);
  } else {
    i = in2.size(1);
  }
  in1->wav.hrv.pVLF.set_size(1, i);
  stride_0_1 = (in1->wav.hrv.aVLF.size(1) != 1);
  stride_1_1 = (in2.size(1) != 1);
  if (in2.size(1) == 1) {
    loop_ub = in1->wav.hrv.aVLF.size(1);
  } else {
    loop_ub = in2.size(1);
  }
  for (i = 0; i < loop_ub; i++) {
    in1->wav.hrv.pVLF[i] =
        in1->wav.hrv.aVLF[i * stride_0_1] / in2[i * stride_1_1] * 100.0;
  }
}

//
// File trailer for eml_mtimes_helper.cpp
//
// [EOF]
//
